<template>
  <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" background-color="#545c64"
    text-color="#fff" active-text-color="#ffd04b" router>
    <el-menu-item v-for="menu in menuList" :index="menu.path" :key="menu.path">
      {{ menu.name }}
    </el-menu-item>
  </el-menu>
</template>
<script>
export default {
  name: 'GlobalHeader',
  data() {
    return {
      activeIndex: this.$route.path,
      menuList: [
        {
          name: '英雄',
          path: '/legends'
        },
        {
          name: '装备',
          path: '/equipment'
        },
        {
          name: '饿了么',
          path: '/element'
        }
      ]
    }
  }
}
</script>

<style scoped lang="scss"></style>
